<!DOCTYPE html>
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="format-detection" content="telephone=no" />
    <link rel="stylesheet" href="{{asset('/images/didi/css.css?'.time())}}">
    <script src="{{asset('/js_system/jquery.min.js')}}"></script>

    <script src="https://cdn.bootcss.com/angular.js/1.5.0/angular.min.js"></script>
    <script src="{{asset('/images/didi/js.js')}}"></script>
    {{--<script src="//static.udache.com/gulfstream/webapp/js/didi.base.js"></script>--}}
    <script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js" type="text/javascript" charset="utf-8"></script>

    <title>{{$flagInfo->name}}的新学期Flag</title>

    <script>

        var host    = "http://{{$host}}";
        var flagId  = "{{$flagInfo->id}}";
        var openId  = "{{$openId}}";
        var  isPlay = 0;



        window.onload = function() {
            wxshareinit();


            // WeixinJSBridge.invoke('getNetworkType', {}, function (e) {
            //     console.log(e);
            //     if(isPlay == 0)
            //     {
            //         var soundHandle = document.getElementById('soundHandle');
            //         soundHandle.setAttribute('src', 'http://{{$host}}/images/didi/didi.mp3');
            //         soundHandle.loop = true;
            //         soundHandle.play();
            //         isPlay = 1;
            //     }
            // });

            $(window).on('touchmove',function(){
                if($(window).scrollTop() >= 20)
                {   
                    $('.more').remove();    
                    $(window).off('touchmove');
                }
            })
          
        }

        function wxshareinit(){
            var host    = "http://{{$host}}";
            var title   = "滴滴Flag实验室";
            var link    = host + "/www/didi/commentFlag?id={{$flagInfo->id}}";
            var imgUrl  = host + "/images/didi/wxshare.png";
            var desc    = "{{$shareData}}";
            var groupTitle = desc;

            wx.config(<?php echo $weixinJs->config($apiList, false) ?>);
            wx.ready(function()
            {
                wx.onMenuShareTimeline({
                    title: groupTitle,
                    link: link,
                    imgUrl: imgUrl
                });

                //获取“分享给朋友”按钮点击状态及自定义分享内容接口
                wx.onMenuShareAppMessage({
                    title: title, // 分享标题
                    desc: desc, // 分享描述
                    link: link, // 分享链接，该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
                    imgUrl: imgUrl // 分享图标
                });

//                wx.showMenuItems({
//                    menuList: ['onMenuShareTimeline','onMenuShareAppMessage'] // 要显示的菜单项，所有menu项见附录3
//                });
            });
        }


    </script>

    


    

</head>
<body>

<audio id="soundHandle" style="display:none;"></audio>
<div class="shareimg">
    <img src="{{asset("/images/didi/share.png")}}"  onclick="didi2.closeShare()">
</div>


<img src="{{asset("/images/didi/shareimg/".$flagInfo->id.".jpg")}}" style="width:100%;display: block;">    




    <div class="middle" style="margin-bottom:40px;">
        <img src="{{asset("/images/didi/2.jpg")}}">
        <div class="alink">
            <a href="https://dc.tt/15nRw"></a>
            <a href="" onclick="didi2.showSare();return false;"></a>
        </div>
    </div>


          



    <div>
        <ul class="flags">
            @foreach($flags as $flag)
            <li>
                   <p class="title">{{$flag->name}} 的Flag</p>
                    <p class="content">
                        <span>{{$flag->flag}}</span>
                    </p>
                    
                    <p  class="content">
                         <label class="zan-span">
                            @if($flag->zan_id > 0)
                                <img src="{{asset('images/didi/zan-yes.png')}}" >
                            @else
                                <img  src="{{asset('images/didi/zan-no.png')}}" id="zan-flag-img-{{$flag->id}}" onClick="didi2.zan({{$flag->id}},'flag')">
                            @endif
                            <span id="zan-flag-{{$flag->id}}" class="zan-num"  zan="1" >{{$flag->zan_number}}</span> 
                        </label>
                    </p>
            </li>
            @endforeach
        </ul>

        <p class="more tiaodong" ng-if="showbtn"><img src="{{asset('images/didi/more.png')}}"></p>

        <!-- <p class="more" ng-if="showbtn"><img src="{{asset('images/didi/more.png')}}" ng-click="getFlag()"></p> -->
    
    </div>
    


    <div class="myalert">
        <div class="alert-box">
            <p class="title" id="alertTitle">您的评论成功</p>
            <p class="btn" onclick="didi2.closeAlert();">确定</p>
        </div>
    </div>

</body>
</html>

